﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Web;
using System.Data;

namespace Web.Wcf
{
    [ServiceContract(Namespace = "http://wcf.soujb.com/Service/web/")]

    public interface IService
    {
        [OperationContract]
        [WebInvoke(
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json, Method = "GET")]
        string getMsg();

        [OperationContract]
        [WebInvoke(
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json)]
        string setMsg(string msg);

        [OperationContract]
        [WebInvoke(
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json, Method = "GET")]
        Data getData();

        [OperationContract]
        [WebInvoke(
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json)]
        Data setData(Data data);

        [OperationContract]
        [WebInvoke(
            BodyStyle = WebMessageBodyStyle.WrappedRequest,
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json, Method = "GET")]
        List<B> getli();

    }
    [DataContract]
    public class Data
    {
        [DataMember]
        public string Name { get; set; }
        [DataMember]
        public int age { get; set; }
        [DataMember]
        public string msg { get; set; }
        [DataMember]
        public string[] array { get; set; }
    }
    public class B
    {
        public List<A> li { get; set; }
    }
    public class A
    {
        public List<string> x { get; set; }
    }
}
